<template>
  <j-modal :title="title" width="90%" :titleColor="titleColor" :visible="visible" :keyboard="false" @cancel="visible = false"
    wrapClassName="ant-modal-cust-warp" style="top:5%;height: 100%">
    <template slot="footer">
      <a-button key="back" @click="visible = false">关闭</a-button>
    </template>
    <a-spin :spinning="confirmLoading">
      <a-table ref="table" bordered size="middle" rowKey="id" :columns="columns" :dataSource="dataSource"
        :pagination="ipagination" @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="myHandleDetail(record, 4, '详情')">详情</a>
        </span>
      </a-table>
    </a-spin>
    <BusinessModalEdit ref="BusinessModalEdit"></BusinessModalEdit>
  </j-modal>
</template>
<script>
  import BusinessModalEdit from "@/views/BusinessManage/modules/BusinessModalEdit.vue"
export default {
  name: 'CustomCountDetail',
  data() {
    return {
      title: "",
      visible: false,
      confirmLoading: false,
      dataSource: [],
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " 共" + total + "条"
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      columns: [
        { title: '单号', dataIndex: 'odd', width: 100, align: "center" },
        { title: '门店名称', dataIndex: 'storeName', width: 100, align: "center" },
        { title: '业务员', dataIndex: 'ope', width: 60, align: "center" },
        { title: '业务类型', dataIndex: 'type', width: 60, align: "center" },
        { title: '业务状态', dataIndex: 'status', width: 60, align: "center", scopedSlots: { customRender: "customRenderFlag" } },
        { title: '寄存金额', dataIndex: 'amountCount', width: 60, align: "center" },
        { title: '利润', dataIndex: 'profit', width: 60, align: "center" },
        { title: '开单时间', dataIndex: 'startTimeStr', width: 70, align: "center" },
        { title: '操作时间', dataIndex: 'updateTimeStr', width: 80, align: "center" },
        { title: '寄存到期时间', dataIndex: 'endTimeStr', width: 80, align: "center" },
        {
          title: '操作', dataIndex: 'action', width: 60, align: "center",
          // fixed: 'right',
          scopedSlots: { customRender: 'action' },
        }
      ],
      url: {
        detail: "/business/getBusinessManageInfo",
      }
    }
  },
  props:{
    titleColor: {
        type: String,
        default:"black"
      }
  },
  components:{
    BusinessModalEdit
  },
  methods: {
    myHandleDetail(record, opeType, title) {
      this.$refs.BusinessModalEdit.editCus(record, opeType, this.url.detail);
      this.$refs.BusinessModalEdit.title = title;
      this.$refs.BusinessModalEdit.disableSubmit = true;
    },
    handleTableChange(...arg) {
      this.ipagination.current = arg[0].current
    },
    show(msg, data) {
      this.title = msg
      this.visible = true
      this.dataSource.splice(0, this.dataSource.length)
      this.dataSource.push(...data)
      console.log(this.dataSource, 'model');
    }
  },
}
</script>

<style></style>